<?xml version="1.0"?>
<component name="org.nuxeo.search.ui.pageproviders.override">

  <require>org.nuxeo.search.ui.pageproviders</require>

  <extension point="providers" target="org.nuxeo.ecm.platform.query.api.PageProviderService">

    <coreQueryPageProvider name="SAVED_SEARCHES">
      <property name="maxResults">DEFAULT_NAVIGATION_RESULTS</property>
      <pattern>
        SELECT * FROM Document WHERE ecm:mixinType = 'SavedSearch'
        AND dc:creator = ? AND ecm:isProxy = 0
        AND ecm:isCheckedInVersion = 0
        AND ecm:currentLifeCycleState != 'deleted'
        AND SORTED_COLUMN IS NOT NULL
      </pattern>
      <sort ascending="true" column="dc:title"/>
    </coreQueryPageProvider>

    <coreQueryPageProvider name="SHARED_SAVED_SEARCHES">
      <property name="maxResults">DEFAULT_NAVIGATION_RESULTS</property>
      <pattern>
        SELECT * FROM Document WHERE ecm:mixinType = 'SavedSearch'
        AND dc:creator != ? AND ecm:isProxy = 0
        AND ecm:isCheckedInVersion = 0
        AND ecm:currentLifeCycleState != 'deleted'
        AND SORTED_COLUMN IS NOT NULL
      </pattern>
      <sort ascending="true" column="dc:title"/>
    </coreQueryPageProvider>

  </extension>

</component>
